RemoveAllCopies Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Searches the bag for all items equal to item, and removes all of them from the bag. If not found, the bag is unchanged.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public int RemoveAllCopies(
	T item
)
Visual Basic (Declaration)
Public Function RemoveAllCopies ( _
	item As T _
) As Integer
Visual C++
public:
int RemoveAllCopies (
	T item
)

Parameters

item
T
The item to remove.

Return Value

The number of copies of item that were found and removed.

Remarks

Equality between items is determined by the comparer instance used to create the bag.

RemoveAllCopies() takes time O(M log N), where N is the total number of items in the bag, and M is the number of items equal to item.

See Also